<template>
    <div class="quarterly_report">
       <div v-if="formType == 1">
            <xlUntil text="资质证书" :queryParam="queryParam"  :filtersVislble="true"  :addBtn="true" :untilVisible="false"  v-bind="$attrs" @delBatch="delBatch" @addForm="addForm"  @searchKeyWord="searchKeyWord" :export-xls-data="columns" :export-xls-url="url.exportXlsUrl"></xlUntil>  
            <div class="xl-table-content">
                <xlTable
                        :columns="columns"
                        :dataSource="data"
                        rowKey="id"
                        :pagination="false"
                        :loading="loading"
                        @change="handleTableChange"
                        bordered
                        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
                    >
                    <template v-slot:action="scope">
                        <a @click="editForm(scope.record)">编辑</a>
                            <a-divider type="vertical"/>
                            <a-dropdown>
                                <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
                                <a-menu slot="overlay">
                                    <a-menu-item @click="seeForm(scope.record)">
                                        <a>查看</a>
                                    </a-menu-item>
                                    <a-menu-item>
                                        <a-popconfirm title="确定删除吗?" @confirm="() => delForm(scope.record.id)">
                                            <a>删除</a>
                                        </a-popconfirm>
                                    </a-menu-item>
                                </a-menu>
                            </a-dropdown>
                    </template>
                </xlTable>
            </div>
        </div>
        <div v-else>
            <xlUntil text="资质证书" :queryParam="queryParam"  :filtersVislble="true"  :addBtn="false" :untilVisible="false"  v-bind="$attrs" @delBatch="delBatch" @addForm="addForm"  @searchKeyWord="searchKeyWord" :export-xls-data="columns" :export-xls-url="url.exportXlsUrl"></xlUntil>
            <div class="xl-table-content">
                <xlTable
                        :columns="columns"
                        :dataSource="formData.advisoryBodyCertificateList"
                        rowKey="id"
                        :pagination="false"
                        :loading="loading"
                        @change="handleTableChange"
                        bordered
                        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
                    >
                    <template v-slot:action="scope">
                        <a @click="seeForm(scope.record)" >查看</a>
                    </template>
                </xlTable>
            </div>
        </div>
        <xlForm ref="xlForm" @handleOk="handleOk"></xlForm>
        <seeForm ref="seeForm"></seeForm>
    </div>
</template>

<script>

    import xlMixin from '../../mixin/index'

    
    export default {
        name: "index",
        mixins:[xlMixin],
        data(){
            return{
                columns:[
                    {
                        title: '编号',
                        key: 'rowIndex',
                        align: "center",
                        fixed: 'left',
                        width:'80px',
                        customRender: function (t, r, index) {
                            return parseInt(index) + 1;
                        }
                    },
                    {
                        title: '证书名称',
                        dataIndex: 'certificateName',
                        fixed: 'left',
                        type:'input'
                    },
                    {
                        title: '证书获得时间',
                        dataIndex: 'gainDate',
                        // tableVisible:true, 列表不展示
                        type:'date'
                    },
                    {
                        title: '证书类型',
                        dataIndex: 'certificateType',
                        type:'input'
                    },
                    {
                        title: '证书编号',
                        dataIndex: 'certificateCode',
                        type:'input'
                    },
                    {
                        title: '发布单位',
                        dataIndex: 'issuingDepartment',
                        type:'input',
                        span:2
                    },
                    {
                        title: '证书图片',
                        dataIndex: 'certificateImageUrl',
                        type:'upload'
                    },
                    {
                        title: '操作',
                        dataIndex: 'action',
                        align: "center",
                        fixed: 'right',
                        width:'150px',
                        scopedSlots: {customRender: 'action'},
                    }
                ],
                // 请求参数
                paramMore:{
                   
                },
                url: {
                    list: "/supermarket/api/advisory/body/certificate/pageList",
                    add: '/supermarket/api/advisory/body/certificate/add',
                    edit: '/supermarket/api/advisory/body/certificate/update',
                    delete: "/supermarket/api/advisory/body/certificate/remove",
                    deleteBatch: "/ndo/api/ndo/hatch/company/remove",
                    exportXlsUrl: "ndo/api/new/dev/org/export/introduction/company",
                    importExcelUrl: "ndo/api/ndo/hatch/company/importExcel",
                    importExcelDemoUrl:'/ndo/api/ndo/hatch/company/importTemplate'
                }
            }
        },
        props:{
            formData:{}, 
            formType:Number,
            userType:Number
        },
        created(){
            if(this.userType == 99){
                this.paramMore.advisoryBodyCode = this.formData.advisoryBodyBase.advisoryBodyCode
            }
            this.formatMerge()
            this.pageOnload()
        },
        watch:{
        
       },
       methods:{
       },
       components:{
        
       }
    }
</script>
<style scoped>

</style>
